Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script> function convert(degree) { if (degree == "C") { F = document.getElementById("c").value * 9 / 5 + 32; document.getElementById("f").value = Math.round(F); } else { C = (document.getElementById("f").value -32) * 5 / 9; document.getElementById("c").value = Math.round(C); } } </script> </head> <body> <p>Insert a number into one of the input fields below:</p> <input id="c" onkeyup="convert('C')"> degrees Celsius<br> equals<br> <input id="f" onkeyup="convert('F')"> degrees Fahrenheit <p>Note that the <b>Math.round()</b> method is used, so that the result will be returned as an integer.</p> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_celsius by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:24:18 GMT --> </html>
Result:
Try it Yourself - © w3schools.com